package com.wl.mvi.home.ui

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.wl.lib.extension.dp
import com.wl.mvi.home.model.bean.ArticleItem
import com.wl.mvi.databinding.ItemArticleBinding


// Created by wangliang on 2024/4/26.
class ArticleItemView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {

    private val binding = ItemArticleBinding.inflate(LayoutInflater.from(context), this)

    init {
        setPadding(16.dp, 16.dp, 16.dp, 16.dp)
    }

    fun render(item: ArticleItem) {
        binding.titleTv.text = item.title
    }
}